<?php

/**
 * UserAccount form base class.
 *
 * @method UserAccount getObject() Returns the current form's model object
 *
 * @package    vmdai
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseUserAccountForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                 => new sfWidgetFormInputHidden(),
      'user_id'            => new sfWidgetFormInputText(),
      'quota'              => new sfWidgetFormInputText(),
      'use_quota'          => new sfWidgetFormInputText(),
      'surplus_quota'      => new sfWidgetFormInputText(),
      'recharge'           => new sfWidgetFormInputText(),
      'remaining_money'    => new sfWidgetFormInputText(),
      'investment'         => new sfWidgetFormInputText(),
      'interest'           => new sfWidgetFormInputText(),
      'loan_success_money' => new sfWidgetFormInputText(),
      'blocked_money'      => new sfWidgetFormInputText(),
      'unable_draw'        => new sfWidgetFormInputText(),
      'draw_locked'        => new sfWidgetFormInputText(),
      'locked_balance'     => new sfWidgetFormInputText(),
      'balance'            => new sfWidgetFormInputText(),
      'created_at'         => new sfWidgetFormDateTime(),
      'updated_at'         => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                 => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'user_id'            => new sfValidatorInteger(),
      'quota'              => new sfValidatorNumber(array('required' => false)),
      'use_quota'          => new sfValidatorNumber(array('required' => false)),
      'surplus_quota'      => new sfValidatorNumber(array('required' => false)),
      'recharge'           => new sfValidatorNumber(array('required' => false)),
      'remaining_money'    => new sfValidatorNumber(array('required' => false)),
      'investment'         => new sfValidatorNumber(array('required' => false)),
      'interest'           => new sfValidatorNumber(array('required' => false)),
      'loan_success_money' => new sfValidatorNumber(array('required' => false)),
      'blocked_money'      => new sfValidatorNumber(array('required' => false)),
      'unable_draw'        => new sfValidatorNumber(array('required' => false)),
      'draw_locked'        => new sfValidatorNumber(array('required' => false)),
      'locked_balance'     => new sfValidatorNumber(array('required' => false)),
      'balance'            => new sfValidatorNumber(array('required' => false)),
      'created_at'         => new sfValidatorDateTime(),
      'updated_at'         => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('user_account[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'UserAccount';
  }

}
